<!DOCTYPE html>
<html lang="en"

      xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">

  <title>用户编辑</title>
  <style>
    nav {
      font-size: 1.5rem;
      background-color: #21D4FD;
      background-image: -webkit-linear-gradient(19deg, #21D4FD 0%, #B721FF 100%);
      background-image: -moz-linear-gradient(19deg, #21D4FD 0%, #B721FF 100%);
      background-image: -o-linear-gradient(19deg, #21D4FD 0%, #B721FF 100%);
      background-image: linear-gradient(19deg, #21D4FD 0%, #B721FF 100%);
    }
    h1 {
      font-size: 2rem;
    }
    li {
      margin: 10px 20px;
    }
    body {
      /*             background-image: url("../static/img/2.jpg"); */
      background-size: cover;
    }






  </style>
</head>
<body>

<!--图书编辑页面-->
<nav class="navbar navbar-expand-sm bg-primary navbar-dark">
  <ul class="navbar-nav">
    <li>
      <h1><a th:href="@{/web/toindex(admin='admin')}" style="color: white; text-decoration: none">恋文图书管理系统</a></h1>
    </li>
    <li class="nav-item">
      <a class="nav-link" th:if="${session.user.admin} eq '1'" th:href="@{/book/showbook}">图书管理</a>
      <a class="nav-link" th:if="${session.user.admin} eq '0'" th:href="@{/book/showbook1}">图书信息</a>
    </li>
    <li class="nav-item">
      <a class="nav-link" th:if="${session.user.admin} eq '1'" th:href="@{/user/showuser}">读者管理</a>
    </li>
    <li class="nav-item">
      <a class="nav-link" th:if="${session.user.admin} eq '1'" >借还管理</a>
      <a class="nav-link" th:if="${session.user.admin} eq '0'" >借还记录</a>
    </li>
  </ul>


  <div class="text-white" style="font-size: medium; position: absolute; bottom: 30px; right: 40px">
    <div class="dropdown">
      <a class="dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
         th:text="${session.user.username}+', 您好'">
      </a>
      <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
        <a th:if="${session.user.admin} eq '0'" class="dropdown-item" th:href="@{/web/tofollowlist}" >收藏列表</a>
        <a th:if="${session.user.admin} eq '0'" class="dropdown-item" th:href="@{/user/userinfo(username = ${session.user.username})}" >个人信息</a>
        <a th:if="${session.user.admin} eq '0'" class="dropdown-item" th:href="@{/web/toupdatepw}">修改密码</a>
        <a class="dropdown-item" th:href="@{/user/logout}">注销</a>
      </div>
    </div>
  </div>
</nav>


<div class="container">
  <table class="table">
    <tr>
      <th>姓名</th>
      <td th:text="${user.name}"></td>
    </tr>
    <tr>
      <th>性别</th>
      <td th:text="${user.sex}"></td>
    </tr>
    <tr>
      <th>生日</th>
      <td th:text="${#dates.format(user.birth,'yyyy-MM-dd')}"></td>
    </tr>

    <tr>
      <th>地址</th>
      <td th:text="${user.address}"></td>
    </tr>
    <tr>
      <th>联系方式</th>
      <td th:text="${user.telephone}"></td>
    </tr>

    <tr>
      <th>权限</th>
      <div th:switch="${user.admin}">
        <td th:case="1">管理员</td>
        <td th:case="0">用户</td>
      </div>
    </tr>

  </table>
  <a th:href="@{/user/showuser}" class="btn btn-outline-primary btn-lg">返&nbsp;&nbsp;&nbsp;&nbsp;回</a>
</div>

</body>
<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
</html>